import 'package:flutter/material.dart';
import 'package:flutter_trip/widgets/common_image.dart';
import './data.dart';

var textStyle = TextStyle(fontSize: 14, color: Colors.black54);

class ItemWidget extends StatelessWidget {
  final InfoItem data;

  const ItemWidget({Key key, this.data}) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return Container(
      height: 100.0,
      padding: EdgeInsets.all(8.0),
      child: Row(
        children: [
          CommonImage(data.imageUrl, height: 150.0, width: 120.0,),
          Padding(padding: EdgeInsets.only(left: 10)),
          Expanded(
            child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceBetween,
              children: [
                Text(data.title,
                  style: TextStyle(fontWeight: FontWeight.w600, color: Colors.black),
                ),
                Row(
                  mainAxisAlignment: MainAxisAlignment.spaceBetween,
                  children: [
                    Text(data.source, style: textStyle,),
                    Text(data.time, style: textStyle,)
                  ],
                )
              ],
            ),
          )
        ],
      ),
    );
  }
}